import 'package:flutter/material.dart';
import 'dart:async';

class LoadingPage extends StatefulWidget{
  @override

  _loadPage createState() => _loadPage();
}

class _loadPage extends State<LoadingPage>{

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    Future.delayed(Duration(seconds: 1),(){
      print("启动页");
      Navigator.of(context).pushReplacementNamed("logoin");
    });
  }

  @override
  void dispose() {
    // TODO: implement dispose
    print("LoginPage");
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    final size = MediaQuery.of(context).size;
    final width = size.width;
    final height = size.height;
    return Scaffold(
//        backgroundColor: Colors.red,
        body: Container(
          child: Stack(
            children: <Widget>[
//              Image.asset("images/loading.png"),
              Image.asset("images/loading.png",width: width,height: height,fit: BoxFit.fill,),
              new Positioned(
                bottom: 40.0,
//                height: 67,
                left: (size.width - (67 + 17 + 113))/2.0,
                child: SizedBox(
                  width: 67,
                  height: 67,
                  child: Card(
                    shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
                    color: Color(0xFF212228),
                  ),
                )
              ),
              new Positioned(
                  bottom: 53.5,
                  height: 40,
                  left: (size.width - (67 + 17 + 113))/2.0 + 13.5,
                  child:  Image.asset("images/logo.png",width: 40,height: 40,fit: BoxFit.fill)
              ),
              new Positioned(
                  bottom: 73.0,
                  left: (size.width - (67 + 17 + 113))/2.0 + 13.5 + 40 + 15,
//                  right: (size.width - (67 + 17 + 113))/2.0,
                  height: 28,
                  child: Text("智慧经分",style: TextStyle(
                    fontSize: 24.0,
                    color: Colors.white,
                    letterSpacing:6,
                  ),),
              ),
              new Positioned(
                bottom: 48.0,
//                right: (size.width - (67 + 17 + 113))/2.0,
                left: (size.width - (67 + 17 + 113))/2.0 + 13.5 + 40 + 15,
                height: 21,
                child: Text("一键查看 智能分析",style: TextStyle(
                  fontSize: 13.0,
                  color: Colors.white,
                  letterSpacing:1,
                ),),
              ),
            ],

          ),
        )
    );
  }
}
